#! /bin/bash
# GROOT points ot the root directory in which lib, bin and doc 
# directories will be placed. 
# GSRTROOT points to the root directory containing the source 
# code.  This is used by makefiles in various directories to
# load the standard settings from $GSRCROOT/Setup/Setup.$GOSDIR
#
GROOT=$PWD/..
GSRCROOT=$GROOT
#
# Set the name of the OS in GOSDIR
#
OSNAME=`uname -a | cut -c 1-4`
if [ $OSNAME = "SunO" ]; then
  GOSDIR="Solaris"
elif [ $OSNAME = "IRIX" ]; then
  GOSDIR="IRIX"
elif [ $OSNAME = "Linu" ]; then
  GOSDIR="Linux"
fi
#
# The path for lib, bin, doc, conf directories
#
GLIB=~/lib/$GOSDIR
GINCLUDE=~/include
GBIN=$GROOT/bin/$GOSDIR
GDOC=$GSRCROOT/doc/appdoc
GCONF=$GSRCROOT/config
GDEFAULTS=$GROOT/doc
MPCOLOURS=$GLIB/MPColours.dat

if [ `echo $PATH | grep $GBIN` ]; then echo $PATH > /dev/null; else PATH=$PATH:$GBIN; fi
if [ `echo $LD_LIBRARY_PATH | grep $GLIB` ]; then echo $LD_LIBRARY_PATH > /dev/null; else export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/astro/local/lib; fi
export GROOT
export GDOC
export GBIN
export GLIB
export GINCLUDE
export GOSDIR
export PATH
export GCONF
export GDEFAULTS
export GSRCROOT
export MPCOLOURS
